home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / comms_w / wrshd11.zip / WRSHD.DOC < prev    next >
Text File  |  1995-01-03  |  47KB  |  1,055 lines

  1. Winsock RSHD                                       Version 1.1
  2. Copyright 1994 Denicomp Systems
  3. All Rights Reserved
  4.   
  5.   
  6. DESCRIPTION
  7. -----------
  8.   
  9. Winsock RSHD ("Remote Shell Daemon") is a daemon (server) that accepts
  10. requests for command execution from other hosts on the network and executes
  11. them on the PC running Winsock RSHD.  It runs under Microsoft Windows 3.1
  12. and Windows Sockets compatible TCP/IP stacks.
  13.  
  14. Winsock RSHD is similar to the Unix server of the same name, but provides
  15. some special functionality for the Windows environment, such as:
  16.  
  17.      - Ability to send keystrokes to the command running under Windows
  18.      - Support for the "rcp" command to allow copying to and from the PC
  19.      - Security mechanism to allow/deny access for hosts and users
  20.  
  21. Command requests can come from hosts running other operating systems such as
  22. Unix or from other PC's using the standard "rsh" utility that comes with your
  23. TCP/IP package or Winsock RSH, also available from Denicomp Systems.
  24.  
  25. Files can be copied to the PC or from the PC running Winsock RSHD using the
  26. standard TCP/IP "rcp" command.  This includes the "rcp" command available
  27. with Unix or a PC-based "rcp" command such as Winsock RCP, also available from
  28. Denicomp Systems.
  29.    
  30.  
  31.  
  32. REQUIREMENTS
  33. ------------
  34.  
  35. Winsock RCP requires a PC running Windows 3.1 or higher and a Windows Sockets
  36. compatible TCP/IP stack.  Winsock RSHD has been tested with the following:
  37.  
  38.        Microsoft 32-bit TCP/IP for Windows
  39.        Wollongong Pathway Access
  40.        Novell LAN Workplace for DOS Version 4.2
  41.  
  42. To work with Novell LAN Workplace for DOS, you must have version 4.2 or later
  43. and a WINSOCK.DLL file dated 10/07/94 or later.
  44.  
  45. You also must have the file VBRUN300.DLL installed on your system.  This file
  46. must be in a directory included in your PATH environment variable.  This file
  47. is NOT included with Winsock RSHD.  It can be obtained from a number of BBS
  48. systems and online services.  If you cannot obtain it, please contact Denicomp
  49. Systems for assistance.
  50.  
  51.  
  52. WINSOCK RSHD INSTALLATION
  53. -------------------------
  54.  
  55. To install with Winsock RSHD, use PKUNZIP to uncompress the distribution file
  56. into a directory on your hard disk or onto a diskette.
  57.  
  58. Then use File/Run from the Windows Program Manager menu.  Enter the drive and
  59. directory name that contains the uncompressed files, followed by "SETUP".
  60.  
  61. For example, if you uncompressed Winsock RSHD into the directory C:\WRSHD,
  62. type C:\WRSHD\SETUP.
  63.  
  64. Winsock WRSHD by default will be installed in the C:\WRSHD directory.  You
  65. can specify a different directory if you wish.
  66.  
  67. The Winsock Utilities group will be created.  Icons will be in this group for
  68. Winsock RSHD, along with options to view/print the order form and the manual
  69. for using Winsock RSHD.
  70.  
  71. If you wish to start Winsock RSHD automatically each time you run Windows,
  72. you can copy or move the Winsock RSHD icon to the Windows Start Up program
  73. group.
  74.  
  75.  
  76. WINSOCK RSHD CONFIGURATION
  77. --------------------------
  78.  
  79. You configure Winsock RSHD by double clicking on the Winsock RSHD Configuration
  80. icon in the Winsock Utilities program group.
  81.  
  82. Winsock RSHD may work properly without configuration, depending on the TCP/IP
  83. software you are using and whether or not you wish to enforce security.
  84.  
  85. You must configure Winsock RSHD if:
  86.  
  87.    1) You are using Microsoft's 32-bit TCP/IP for Windows.  You should select
  88.       Method 2 for the Method of Operation option.
  89.  
  90.    2) You wish to enforce security.  That is, you wish to specify which hosts
  91.       and/or users may or may not access the PC through Winsock RSHD.  By
  92.       default, no security is enforced.
  93.  
  94. Otherwise, configuration is not necessary for Winsock RSHD to run, but you may
  95. want to examine the options available.
  96.  
  97. Also note that by using the default Winsock RSHD configuration, you may see
  98. "Warning" messages on the Winsock RSHD screen, especially if your TCP/IP
  99. software does not support an option called "Reuse Address".  You can ignore
  100. this warning if you see it; Winsock RSHD will continue to operate properly.
  101. You can stop the message by setting all "ReuseAddr" options to -1.
  102.  
  103. In the Winsock RSHD Configuration screen, set the desired options, then click
  104. on "OK" to save the configuration and exit.  Click on "Cancel" to discard any
  105. changes you have made and exit.  Click on "Edit Security" to edit the Security
  106. File you have specified using the Windows Notepad editor.  This only works if
  107. you have specified a Security File name.
  108.  
  109. The Winsock RSHD Configuration screen contains the following options:
  110.  
  111.  
  112. Method of Operation:                             (Default: Method 1)
  113.  
  114.        Winsock RSHD has two methods of operation: Method 1 and 2.  The method
  115.        you should use depends on the TCP/IP stack you are using.  Ideally,
  116.        Winsock RSHD should just work, no matter what TCP/IP stack you are
  117.        using.  However, practice shows that there are some internal differences
  118.        in Windows Sockets implementations, especially when implementing servers.
  119.  
  120.        If the default Method 1 does not work (you receive error messages),
  121.        try Method 2.  If neither method works, you can fiddle with the
  122.        Advanced Configuration Options explained later or contact Denicomp
  123.        Systems for assistance.
  124.  
  125.        In general, Method 1 should work with most TCP/IP stacks.  This includes
  126.        Wollongong Pathway Access and Novell LAN Workplace for DOS.  Method 2
  127.        works well with Microsoft's 32-bit TCP/IP for Windows.
  128.    
  129.        Although Method 1 will also work with Microsoft's TCP/IP, it has been
  130.        known to lock up the PC with heavy use, so Method 2 is recommended.
  131.  
  132.  
  133. Minimize on Startup:                             (Default: Not Checked)
  134.  
  135.        If this option is checked, Winsock RSHD will be minimized when it
  136.        starts.  If it is not, you will see the Winsock RSHD window.  The
  137.        Winsock RSHD window displays information about connections, commands
  138.        executed, and any error messages.
  139.  
  140. Message Level:                                   (Default: 0)
  141.  
  142.        Specifies the level of detail of the messages displayed in the
  143.        Winsock RSHD window.  The default level is 0, which gives the least
  144.        amount of detail.  Level 0 will show you when someone receives an error
  145.        trying to execute a command or is denied permission.  Level 1 provides
  146.        more detail about the various stages of Winsock RSHD execution.  Level 2
  147.        provides the highest level of detail.  Levels 1 and 2 are useful if you
  148.        are having problems with Winsock RSHD execution.
  149.  
  150. Security File:                                   (Default: None)
  151.  
  152.        Specify the full path name of the Security File used by Winsock RSHD
  153.        to enforce security (allow and deny users and hosts).  The format of
  154.        this file is explained in more detail later.  If you do not specify a
  155.        Security File, all users and hosts will be granted access to execute
  156.        commands and transfer files to and from your PC.  If the Security File
  157.        you specify does not exist, NO users or hosts will be granted access.
  158.  
  159.        If you do not wish to enforce any security, do not specify a filename.
  160.  
  161. Request Log:                                     (Default: None)
  162.  
  163.        This option allows you to log all requests (commands to be executed)
  164.        in a file you specify.  Each time someone attempts to execute a command
  165.        on the PC, the date and time, the user name, the host name, and the
  166.        command will be written to this file.
  167.  
  168. Deny Log:                                        (Default: None)
  169.  
  170.        This option allows you to log all permission violations in a file you
  171.        specify.  Each time someone is denied permission to execute a command
  172.        on the PC, the date and time, the user name, the host name, and the
  173.        command will be written to this file.
  174.  
  175. Error Log:                                       (Default: None)
  176.  
  177.        This option allows you to log all command execution errors in a file
  178.        you specify.  Each time someone receives an error trying to execute
  179.        a command on the PC, the date and time, the user name, the host name,
  180.        the command, and error message will be written to this file.  These
  181.        are errors that occur after the user has been granted permission to
  182.        execute the command.  For example, an error would be logged if a program
  183.        was to be run that did not exist.
  184.  
  185. NOTE: Each of the log files may refer to the same file name if you wish.
  186.       They will not overwrite each other.  Each message is appended to the
  187.       end of the file.  You should be sure to periodically delete the log
  188.       file(s) because they can get large over time on an actively used PC.
  189.  
  190.  
  191. ADVANCED CONFIGURATION OPTIONS
  192. ------------------------------
  193.  
  194. These configuration options are for advanced users and do not normally
  195. require deviations from their default values.  Full understanding of them
  196. require an understanding of TCP/IP and Windows Sockets operation and
  197. programming.
  198.  
  199. Some options refer to TCP/IP option set on "sockets" used by Winsock RSHD.
  200. Sockets are connections over the network.  Winsock RSHD uses three sockets:
  201.  
  202.      Listen:  Listens for connections.
  203.  
  204.      Conn:    Socket created when a connection is made to receive parameters
  205.               from the "rsh" or "rcp" command.
  206.  
  207.      Stderr:  Socket created to send error messages back to the remote host.
  208.  
  209.  
  210. The advanced options are:
  211.  
  212. Port:                                            (Default: 514)
  213.  
  214.        Specifies the port number that Winsock RSHD listens to for
  215.        connections.  The standard port for the Remote Shell daemon is 514.
  216.  
  217. RCP Block Size:                                  (Default: 1024)
  218.  
  219.        Specifies the number of bytes in a block of data that the Remote Copy
  220.        (RCP) service of Winsock RSHD processes at one time.  When files are
  221.        copied to the PC, it reads from the network and writes to the disk in
  222.        blocks of this size.  When files are copied from the PC, it reads from
  223.        the disk and writes to the network in blocks of this size.  Note that
  224.        this is an internal block size only; it does not change any TCP/IP
  225.        parameters.
  226.  
  227. Listen Backlog:                                  (Default: 5)
  228.  
  229.        The number of requests that can be "backlogged" when Winsock RSHD is
  230.        listening for connections.  The minimum is 1; the maximum is usually 5.
  231.  
  232. Listen Shutdown:                                 (Default: 2)
  233.  
  234.        Specifies how the "Listen" socket is to be shutdown before it
  235.        is closed.  A value of 0 means that it is not shutdown.  A value
  236.        of 1 halts all receiving before shutting down.  A value of 2 halts
  237.        all sending and receiving before shutting down.
  238.  
  239. Listen Linger:                                   (Default: -1)
  240.  
  241.        If this option is set to "0", the TCP/IP "linger" option will be turned
  242.        off for the "Listen" socket.  If this option is set to a value greater
  243.        than zero, the linger option will be turned on and the timeout value
  244.        will be set to the value you assign this option.  If this option is
  245.        set to "-1" or does not appear in the configuration file, no linger
  246.        options will be set; the default linger option specified by your TCP/IP
  247.        package will be in effect.
  248.  
  249. Listen KeepAlive:                                (Default: -1)
  250.  
  251.        If this option is set to "0", the TCP/IP "keepalive" option will be
  252.        turned off for the "Listen" socket.  If this option is set to "1",
  253.        the keepalive option will be turned on.  If this option is set to "-1" or
  254.        does not appear in the configuration file, no keepalive option will be
  255.        set; the default keepalive option specified by your TCP/IP package will
  256.        be in effect.
  257.  
  258. Listen ReuseAddr:                                (Default: 1)
  259.  
  260.        If this option is set to "0", the TCP/IP "ReuseAddr" option (Reuse
  261.        Address) will be turned off for the "Listen" socket.  If this option is
  262.        set to "1", the ReuseAddr option will be turned on.  If this option is
  263.        set to "-1" or does not appear in the configuration file, no ReuseAddr
  264.        option will be set; the default ReuseAddr option specified by your
  265.        TCP/IP package will be in effect.
  266.  
  267. Connection Shutdown:                             (Default: -1)
  268.  
  269.        Sets the "shutdown" option for the connection socket.  See the
  270.        Listen Shutdown option for an explanation of the valid values.
  271.  
  272. Connection Linger:                               (Default: -1)
  273.  
  274.        Sets the "linger" option for the connection socket.  See the Listen
  275.        Linger option for an explanation of the valid values.
  276.  
  277. Connection KeepAlive:                            (Default: -1)
  278.  
  279.        Sets the "keepalive" option for the connection socket.  See the
  280.        Listen KeepAlive option for an explanation of the valid values.
  281.  
  282. Connection ReuseAddr:                            (Default: 1)
  283.  
  284.        Sets the "ReuseAddr" option for the connection socket.  See the
  285.        Listen ReuseAddr option for an explanation of the valid values.
  286.  
  287. Stderr Linger:                                   (Default: -1)
  288.  
  289.        Sets the "linger" option for the standard error socket.  See the
  290.        Listen Linger option for an explanation of the valid values.
  291.  
  292. Stderr KeepAlive:                                (Default: -1)
  293.  
  294.        Sets the "keepalive" option for the standard error socket.  See the
  295.        Listen KeepAlive option for an explanation of the valid values.
  296.  
  297. Stderr ReuseAddr:                                (Default: 1)
  298.  
  299.        Sets the "ReuseAddr" option for the standard error socket.  See the
  300.        Listen ReuseAddr option for an explanation of the valid values.
  301.  
  302. Stderr Shutdown:                                 (Default: 2)
  303.  
  304.        Sets the "shutdown" option for the standard error socket.  See the
  305.        Listen Shutdown option for an explanation of the valid values.
  306.  
  307. WINSOCK RSHD SECURITY FILE
  308. --------------------------
  309.  
  310. With Unix, security is enforced on remote command execution using a
  311. combination of the password file (/etc/passwd), the hosts file (/etc/hosts),
  312. and the host equivalency files (/etc/hosts.equiv and $HOME/.rhosts).
  313.  
  314. Windows 3.1 does not have any security measures at all.  If Winsock RSHD
  315. did not provide for security, any host and user could execute commands through
  316. Winsock RSHD or copy files to and from the PC using the "rcp" command.
  317.  
  318. Winsock RSHD enforces security through its Security File.  The name of this
  319. file is specified in the Winsock RSHD Configuration as the Security File.
  320.  
  321. If you specify a Security File name and the file does not exist or the file is
  322. completely empty, all hosts and users are denied access.
  323.  
  324. Conversely, if you do not specify a Security File, all hosts and users are
  325. granted access.  So if you do not wish to enforce any security, do not specify
  326. a Security File name.
  327.  
  328. You create the Security File using a text editor.  It consists of lines that
  329. specify who may or may not access the PC using Winsock RSHD.  The following
  330. are the options available in the Security File:
  331.  
  332.    #
  333.            Any line beginning with # is treated as a comment and is ignored.
  334.  
  335.    +
  336.            A plus sign (+) on a line by itself specifies that ALL hosts and
  337.            users are granted permission.  This is useful if you wish to allow
  338.            many hosts and users, but deny only a few.  Use the deny options
  339.            on subsequent lines.
  340.  
  341.    host
  342.  
  343.            You can specify a host that is granted permission by entering the
  344.            name of the host on a line by itself.  ALL users on that host are
  345.            granted permission, unless you specifically deny those users on
  346.            subsequent lines.
  347.  
  348.            You may also use the IP address of the host instead (the dotted-
  349.            decimal representation).  If you specify the name of the host,
  350.            that name must appear in the HOSTS file used by your TCP/IP package.
  351.  
  352.    !host
  353.  
  354.            You can specify a host that is denied permission by entering an
  355.            exclamation point (!) followed by the name of the host name of the
  356.            host on a line.  ALL users on that host are denied permission,
  357.            regardless of subsequent lines.
  358.  
  359.            You may also use the IP address of the host instead (the dotted-
  360.            decimal representation).  If you specify the name of the host,
  361.            that name must appear in the HOSTS file used by your TCP/IP package.
  362.  
  363.    +user
  364.            You can specify a user name that is granted permission by entering
  365.            a plus sign (+) followed by the user name on a line.  Do not put
  366.            any spaces between the plus sign and the user name.  That user
  367.            will be granted permission regardless of the host (as long as
  368.            the host is not specifically denied).
  369.  
  370.            See below for an explanation of the source of the "user name" and
  371.            how it is validated.
  372.  
  373.    -user
  374.            You can specify a user name that is to be denied permission by
  375.            entering a minus sign (-) followed by the user name on a line.
  376.            Do not put any spaces between the plus sign and the user name.
  377.            That user will be denied permission on all hosts.
  378.  
  379.            See below for an explanation of the source of the "user name" and
  380.            how it is validated.
  381.  
  382.   +user@host
  383.  
  384.            You can specify a user name and a host that is granted permission
  385.            by entering a plus sign (+) followed by the user name, an at-sign
  386.            (@), followed by the host name on a line.  Do not put any spaces
  387.            between the plus sign and the user name or before or after the
  388.            at-sign.  That user on the specified host will be granted
  389.            permission, but only from that host.
  390.  
  391.            You may also use the IP address of the host instead (the dotted-
  392.            decimal representation).  If you specify the name of the host,
  393.            that name must appear in the HOSTS file used by your TCP/IP package.
  394.  
  395.   -user@host
  396.  
  397.            You can specify a user name and a host that is denied permission
  398.            by entering a minus sign (-) followed by the user name, an at-sign
  399.            (@), followed by the host name on a line.  Do not put any spaces
  400.            between the minus sign and the user name or before or after the
  401.            at-sign.  That user on the specified host will be denied
  402.            permission, but only when coming from that host.
  403.  
  404.            You may also use the IP address of the host instead (the dotted-
  405.            decimal representation).  If you specify the name of the host,
  406.            that name must appear in the HOSTS file used by your TCP/IP package.
  407.  
  408. If the request is coming from a Unix system, the user name is the login name
  409. of the user.  If the request is coming from another Windows PC, the method of
  410. specifying the user name is determined by the implementation of the "rsh" or
  411. "rcp" command you are using.
  412.  
  413. Note that the standard Unix "rsh" command (and the Winsock RSH command
  414. available from Denicomp Systems) allows a "-l" option to specify an alternate
  415. user name.  The "-l" option has meaning on a Unix system, but is not especially
  416. useful with Winsock RSHD.  However, if you do use the "-l" option to specify
  417. an alternate user, as with Unix, that user must be granted permission through
  418. the Security File in addition to the login name (Unix) or the name specified
  419. in your particular TCP/IP implementation (Windows/DOS).
  420.  
  421. USING THE SECURITY FILE
  422. -----------------------
  423.  
  424. To effectively use the Security File, you must first understand how it is
  425. viewed by Winsock RSHD.
  426.  
  427. When Winsock RSHD receives a request, it sequentially processes the lines
  428. in the Security File to determine whether or not the host and user is granted
  429. or denied access.  It looks at each line in the Security File until it
  430. determines that either the host or the user is specifically denied permission.
  431.  
  432. Winsock RSHD begins by assuming that permission is denied for the request.  It
  433. then examines the lines in the Security File to see if any of the lines
  434. pertain to this request.
  435.  
  436. Once Winsock RSHD finds a line that denies access to either the user or the
  437. host, it stops looking and denies permission.
  438.  
  439. If it finds a line that grants permission to the user and/or host, permission
  440. is tentatively granted, but it continues to process the lines in the Security
  441. File.
  442.  
  443. If it processes the entire Security File and does not find a line that grants
  444. permission to the user and/or the host, permission is denied.   If security
  445. was tentatively granted at some point and not denied subsequently, permission
  446. is granted.
  447.  
  448. For example, let's say that the following is the contents of the Security File:
  449.  
  450.            jetty
  451.            booey
  452.            eib
  453.            192.56.42.3
  454.            rs6000
  455.            +fred@mars
  456.            -gary@booey
  457.            -jackie
  458.            +robin
  459.  
  460. In this example, if any user on the host "jetty" makes a request,
  461. permission will be granted, unless the user is "jackie", since "jackie" is
  462. denied access from all hosts (-jackie).
  463.  
  464. If "jackie@jetty" makes a request, Winsock RSHD reads through the Security File
  465. and finds the host name "jetty", and tentatively grants permission.  However, it
  466. continues and finds that the user "jackie" is denied from all hosts, so
  467. permission is denied.
  468.  
  469. Also, if any user on the host "booey" makes a request, they are granted
  470. permission unless the user is "gary", since "gary@booey" is specifically
  471. denied permission (-gary@booey).  All other users on the host "booey" are
  472. granted permission except "jackie" (-jackie).
  473.  
  474. The user "fred" on the host "mars" is granted permission because of the
  475. line "+fred@mars".  However, since the host "mars" does not appear on
  476. a line by itself, no other users on the host "mars" are granted permission
  477. except the user "robin", who is granted permission from ANY host (+robin).
  478.  
  479. THE WINSOCK RSHD WINDOW
  480. -----------------------
  481.  
  482. The Winsock RSHD window displays information about connections to the PC.  You
  483. can use it to monitor access to the PC.
  484.  
  485. +-----------------------------------------------------------------------------+
  486. | = |                           Winsock RSHD                         | ^ | v  |
  487. +-----------------------------------------------------------------------------+
  488. |                                                                             |
  489. | Status:                                                                     |
  490. |    Accepting connections...                                                 |
  491. |                                                                             |
  492. | Last Connection:                                                            |
  493. |    Connected to rs6000 (89.0.0.10)                                          |
  494. |    Local User: tomf  Remote User: tomf                                      |
  495. |                                                                             |
  496. | Last Command:                                                               |
  497. |    <%FO\docs\invoice.doc~%FP~%FX> word                                      |
  498. |                                                                             |
  499. | Messages:                                                                   |
  500. |                                                                             |
  501. |                                                                             |
  502. |                                                                             |
  503. |                                                                             |
  504. |                                                                             |
  505. +-----------------------------------------------------------------------------+
  506.  
  507. The window contains the following sections:
  508.  
  509. Status:
  510.  
  511.       The current status of Winsock RSHD.
  512.  
  513. Last Connection:
  514.  
  515.       The host name (if found in the HOSTS file on the PC), the IP address,
  516.       the local user name, and remote user name of the last connection to
  517.       the PC through Winsock RSHD.
  518.  
  519. Last Command:
  520.  
  521.       The last command executed through Winsock RSHD.
  522.  
  523. Messages:
  524.  
  525.       A scrolling list of various messages displayed by Winsock RSHD.  The
  526.       messages that display here depend on the Message Level parameter in
  527.       the Winsock RSHD Configuration.  With the default Message Level of 0,
  528.       you will see notification of any permission violations or command
  529.       execution errors (i.e. command not found).
  530.  
  531. To stop Winsock RSHD, double-click on the button in the top left corner of
  532. the window or click on it once and choose "Close" from the menu.
  533.  
  534. To find the version of Winsock RSHD you are using, click once on the button
  535. in the top left corner of the window and choose "About" from the menu.
  536.  
  537. EXECUTING COMMANDS
  538. ------------------
  539.  
  540. With Unix, the "rsh" utility executes the specified command on a remote host
  541. and returns the standard output and the standard error output to the requesting
  542. host.
  543.  
  544. With Windows, there is no such thing as "standard output" and "standard
  545. error".  Programs execute in graphical windows, so there is no way to return
  546. any output using "rsh".
  547.  
  548. Therefore, when using "rsh" from Unix or another PC to initiate commands on
  549. a Windows PC, you will not see any output of the command on your screen.  It
  550. will display on the PC that received the request.
  551.  
  552. For example, if you used the following command:
  553.  
  554.           rsh winpc3 excel
  555.  
  556. This would start Excel on the PC named "winpc3".  You would see nothing on your
  557. screen as a result of starting Excel.  Excel would be running on the screen of
  558. the PC named "winpc3".
  559.  
  560. The "rsh" command will NOT wait for the specified command to complete.  The
  561. system issuing the request will regain control immediately after the command
  562. begins, unless the command is a DOS program and Windows is not set up to
  563. exclusively execute the DOS command.
  564.  
  565. If you attempt to execute a command that does not exist or Windows returns an
  566. error trying to load the program, you will receive a descriptive error message
  567. on your screen from Winsock RSHD to tell you that the command was not
  568. successfully executed.
  569.  
  570. UNREGISTRED VERSION NOTE:  The unregistered version of Winsock RSHD returns
  571. a message to the remote host about Winsock RSHD not being registered.  This
  572. does not occur in the registered version.
  573.  
  574.  
  575. SENDING KEYSTROKES
  576. ------------------
  577.  
  578. Winsock RSHD provides the ability for you to send keystrokes to the Windows
  579. application you initiate using the "rsh" command.  It also allows you to
  580. specify how the window is to be displayed (i.e. normal, minimized, maximized,
  581. or hidden).  This provides you with some "remote control" over what the
  582. program you run does once it starts.
  583.  
  584. For those of you who program in Microsoft Visual Basic or the Visual Basic for
  585. Applications macro language, this is very similar to the "SendKeys" capability
  586. of those programming languages.
  587.  
  588.  
  589. The standard syntax of the "rsh" command is:
  590.  
  591.              rsh hostname command
  592.  
  593. This will execute "command" on the host "hostname".  Winsock RSHD allows a
  594. slight modification of the "rsh" syntax to send keystrokes.  This is compatible
  595. with all "rsh" commands.  The alternative syntax for sending keystrokes is:
  596.  
  597.  
  598.              rsh hostname "<keystrokes>" command
  599.  
  600.  
  601. If the first parameter after the host name begins with a less-than sign (<),
  602. that parameter is interpreted as keystrokes to be sent to the command
  603. specified in the next parameter.  The keystrokes must end with a greater-than
  604. sign (>).  You must also enclose the entire parameter in quotes so special
  605. characters and spaces are not interpreted by the operating system.
  606.  
  607. For example, if you wanted to run the Windows Notepad on the PC named "winpc3"
  608. and type "This is a test" on the first line, the command would be:
  609.  
  610.              rsh winpc3 "<This is a test>" notepad
  611.  
  612. If you looked at the winpc3's screen, you would see the Windows Notepad with
  613. "This is a test" on the first line.
  614.  
  615. NOTE: You cannot send keystrokes to an application that is not designed to
  616.       run in Microsoft Windows (i.e. MS-DOS programs).
  617.  
  618.  
  619. SENDING SPECIAL KEYSTROKES
  620. --------------------------
  621.  
  622. Winsock RSHD also allows you to specify special keys in the keystrokes
  623. parameter that cannot normally be typed on a command line, such as embedded
  624. Enter keys, function keys, ALT keys, etc.
  625.  
  626. Keystrokes are sent sequentially as the appear between the "<" and ">".  To
  627. send a single character, use the character itself.  For example, to send the
  628. letter "X", use the letter "X".  To send the word "hello", just specify those
  629. letters.
  630.  
  631. To specify keys combined with any combination of Shift, Ctrl, and Alt keys,
  632. prefix the regular key code with one or more of the following codes:
  633.  
  634.             Shift      +
  635.             Control    ^
  636.             Alt        %
  637.  
  638. For example, to send the Alt-F keystroke, specify "%F".  To send Ctrl-Alt-D,
  639. specify "^%D".
  640.  
  641. To send the Enter key, use the tilde (~).
  642.  
  643. To specify that the Shift, Ctrl, and/or Alt keys should be held down while
  644. several other keys are pressed, enclose the key codes in parentheses ( ).
  645. For example, to have the Alt key held down while X and D are pressed, use
  646. "%(XD)".  You could also use "%X%D", but if the Shift, Ctrl, and/or Alt keys
  647. need to be held down for a number of keystrokes, the parentheses can make the
  648. string shorter.  Also, you would want to use the parentheses if the application
  649. detects the release of the Shift, Ctrl, and/or Alt keys and that is not desired.
  650.  
  651. The following characters have special meaning in the keystroke parameter, so
  652. they must be enclosed inside braces ({ }).  Some of these special characters
  653. have not been explained yet.
  654.  
  655.       Special Character             Example
  656.  
  657.           +  (plus)                   {+}
  658.           ^  (caret)                  {^}
  659.           %  (percent)                {%}
  660.           ~  (tilde)                  {~}
  661.           <  (less than)              {<}
  662.           >  (greater than)           {>}
  663.           [  (left sq. bracket)       {[}
  664.           ]  (right sq. bracket)      {]}
  665.           (  (left paren)             {(}
  666.           )  (right paren)            {)}
  667.           @  (at-sign)                {@}
  668.           {  (left brace)             {{}
  669.           }  (right brace)            {}}
  670.  
  671. To send characters that are not normally displayed when you press a key (such
  672. as Enter or Tab) and keys that represent actions rather than characters, use
  673. the following special codes:
  674.  
  675.    Key                Code                        Key           Code
  676.  
  677.    Backspace     {BACKSPACE} or {BS} or {BKSP}    Break        {BREAK}
  678.    Caps Lock     {CAPSLOCK}                       Clear        {CLEAR}
  679.    Del           {DELETE} or {DEL}                Down Arrow   {DOWN}
  680.    End           {END}                            Enter        {ENTER} or ~
  681.    Esc           {ESCAPE} or {ESC}                Help         {HELP}
  682.    Home          {HOME}                           Ins          {INSERT}
  683.    Left Arrow    {LEFT}                           Num Lock     {NUMLOCK}
  684.    Page Down     {PGDN}                           Page Up      {PGUP}
  685.    Print Screen  {PRTSC}                          Right Arrow  {RIGHT}
  686.    Scroll Lock   {SCROLLLOCK}                     Tab          {TAB}
  687.    Up Arrow      {UP}                             F1           {F1}
  688.    F2            {F2}                             F3           {F3}
  689.    F4            {F4}                             F5           {F5}
  690.    F6            {F6}                             F7           {F7}
  691.    F8            {F8}                             F9           {F9}
  692.    F10           {F10}                            F11          {F11}
  693.    F12           {F12}                            F13          {F13}
  694.    F14           {F14}                            F15          {F15}
  695.    F16           {F16}  
  696.  
  697. You can also specify that a key is to repeat itself a certain number of times,
  698. without repeating the key itself in the string.  To repeat a keystroke, use the
  699. format:
  700.  
  701.                     {keystroke number}
  702.  
  703. Where "keystroke" is the key to repeat, followed by a single space, then the
  704. number of times to repeat the key.
  705.  
  706. For example, to press the down arrow key 8 times, use "{DOWN 8}".  To type
  707. 30 *'s, use: "{* 30}".
  708.  
  709. KEYSTROKE EXAMPLE
  710. -----------------
  711.  
  712. The following example, will start Microsoft Word, load a file, print it,
  713. then exit.
  714.  
  715.            rsh winpc3 "<%FO\docs\invoice.doc~%FP~%FX>" word
  716.  
  717.  
  718. The keystrokes are:
  719.  
  720.                  %F   - Alt-F  (Drops down the file menu)
  721.                   O   - O      (Selects Open)
  722.   \docs\invoice.doc   - Types the filename.
  723.                   ~   - Enter  (Loads the File)
  724.                  %F   - Alt-F  (Drops down the file menu)
  725.                   P   - P      (Selects Print)
  726.                   ~   - Enter  (Accepts the defaults on the Print dialog box)
  727.                  %F   - Alt-F  (Drops down the file menu)
  728.                   X   - X      (Selects eXit and Word exits)
  729.  
  730.  
  731. Note that if this example were being run from a Unix system, you would have to
  732. use two backslashes (\\) for every one desired backslash because the Unix shells
  733. interpret the backslashes as special characters.  The command would then be:
  734.  
  735.            rsh winpc3 "<%FO\\docs\\invoice.doc~%FP~%FX>" word
  736.  
  737.  
  738. KEYSTROKE MACRO FILES
  739. ---------------------
  740.  
  741. If your keystroke strings get rather long or complex, you can store them in a
  742. keystroke macro file so you don't have to specify all of them each time you use
  743. the "rsh" command.
  744.  
  745. To create a keystroke macro file, you must use a text editor (or a word
  746. processor, but be sure to save as an ASCII file).  Enter the keystrokes as you
  747. would on the "rsh" command line, with the following exceptions/reminders:
  748.  
  749.      1) Do not enter "<" as the first character in the file or ">" as the
  750.         last character.  All of the characters you enter in the file will
  751.         be sent.
  752.  
  753.      2) You may press Enter in the file to enter the keystrokes on multiple
  754.         lines.  The line breaks have NO effect on the keystrokes.  They will
  755.         be treated as if they were entered all on the SAME LINE.  That is, you
  756.         must remember to still use "~" or "{ENTER}" to "press" the Enter key.
  757.         Pressing Enter in the file will NOT send the Enter key.
  758.  
  759.      3) You CANNOT nest keystroke macros.  Your macro file CANNOT contain
  760.         references to other keystroke macro files.
  761.  
  762.      4) The keystroke macro file MUST reside on the PC running Winsock RSHD.
  763.         You can create the file on that PC or use "rcp" to copy it to that
  764.         PC before executing the command.
  765.  
  766. To use a keystroke macro file, you enter the at-sign (@) followed by the
  767. filename in braces ({ }) where you would normally specify keystrokes on the
  768. "rsh" command line.
  769.  
  770. You will most likely need to specify a full pathname of the keystroke file
  771. on the PC running Winsock RSHD, unless you know the working directory
  772. of Winsock RSHD on the system running it and the keystroke macro resides
  773. in that directory.  You may use forward slashes (/) instead of backslashes
  774. if you wish; this makes life easier for Unix users because the shell
  775. interprets the backslash characters.
  776.  
  777. For example, if you had a macro in the directory \kbmac\printss.mac on the
  778. PC running Winsock RSHD, you could use it with this command:
  779.  
  780.             rsh winpc2 "<@{/kbmac/printss.mac}>" excel
  781.  
  782. This would run "excel" on winpc2 and send the keystrokes stored in the
  783. file \kbmac\printss.mac to it.
  784.  
  785.  
  786. You can intermix command line keystrokes and macro file keystrokes.  That is,
  787. you can specify some of the keystrokes on the command line and use some from
  788. a macro file.   You can also use multiple macro files.
  789.  
  790. For example, let's say we want to print a file using "rsh" through a Windows
  791. application called "wintiff".  We want to store the keystrokes in a macro
  792. file, but don't want to store the filename in the macro file because it can
  793. change.
  794.  
  795. To do this you can store the first set of keystrokes in one macro file,
  796. specify the filename on the "rsh" command line, then store the remaining
  797. keystrokes in a second file.
  798.  
  799. For example, let's say the file is "mypic.tif":
  800.  
  801.   rcp mypic.tif winpc2:/tmp
  802.   rsh winpc2 "<@{/kb/tifprt1.mac}\tmp\mypic.tif~@{/kb/tifprt2.mac}" wintiff
  803.  
  804. This example copies the file "mypic.tif" to the \tmp directory on winpc2.
  805. Then it runs "wintiff" and first sends the keystrokes from the file
  806. \kb\tifprt1.mac.  That macro ends when "wintiff" requires a filename.
  807. The keystrokes to "type" the filename come from the "rsh" command line
  808. since the tifprt1.mac has ended.  Then it continues by sending the keystrokes
  809. in the file \kb\tifprt2.mac.  That is:
  810.  
  811.     @{/kb/tifprt1.mac}  -  Send keystrokes from \kb\tifprt1.mac
  812.        \tmp\mypic.tif~  -  Type \tmp\mypic.tif and press Enter
  813.     @{/kb/tifprt2.mac}  -  Send keystrokes from \kb\tifprt2.mac
  814.  
  815.  
  816. SPECIFYING THE WINDOW TYPE
  817. --------------------------
  818.  
  819. Winsock RSHD also allows you to specify the window type of the application
  820. being run.  By default, the application is run "normally", as if you ran it
  821. by double-clicking on it's icon (assuming you did not set up the icon to run
  822. it minimized).
  823.  
  824. If you want to specify an different method of displaying the application's
  825. window, you can specify this inside the keystroke parameter by enclosing
  826. the method within square brackets ([ ]).
  827.  
  828. There are two methods of setting the window type.  You can use one of the
  829. words shown below or you can use a number.  The options are:
  830.  
  831.      Window Option                  Displays
  832.  
  833.       NORMAL                        Normal Display as defined by the application
  834.       MINIMIZE                      Shows the application as a minimized icon
  835.       MAXIMIZE                      Maximizes the application on startup
  836.       HIDE                          Hides the application (no icon appears)
  837.  
  838.       0                             Same as HIDE
  839.       1                             Same as NORMAL
  840.       2                             Same as MINIMIZE
  841.       3                             Same as MAXIMIZE
  842.  
  843. Other numeric values may be used - they correspond to the Windows' ShowWindow
  844. function (for all you programmers).
  845.   
  846. For example, if you want to run the Windows Notepad maximized, viewing the
  847. file "heyyou.txt", you would type:
  848.  
  849.            rsh winpc3 "<[MAXIMIZE]>%FOheyyou.txt~" notepad
  850.  
  851. This runs the Notepad maximized, then "presses" Alt-F-O (File Open) and
  852. types the filename "heyyou.txt" and presses Enter to load it.
  853.  
  854. If you wanted to run some application that does some task and exits, you
  855. could run it minimized using:
  856.  
  857.            rsh winpc3 "<[MINIMIZE]>" bkgprint
  858.  
  859. Note that Windows does not allow you to send keystrokes to a minimized
  860. or hidden application.  Therefore, "[MINIMIZE]", "[HIDE]", "[0]", or "[2]"
  861. should always appear alone between the "<" and ">".  If you specify other
  862. keystrokes, the application will not receive them (Windows will beep at you
  863. for each keystroke).
  864.  
  865.  
  866. COPYING FILES USING RCP
  867. -----------------------
  868.  
  869. Winsock RSHD also provides Remote Copy (RCP) Server capability.  This allows
  870. you to copy files to and from a PC running Winsock RSHD using the "rcp"
  871. command.
  872.  
  873. The "rcp" command is commonly found on Unix systems and in some TCP/IP
  874. packages for Windows and DOS.  If your TCP/IP package does not provide the
  875. "rcp" command, you can use Winsock RCP from Denicomp Systems.
  876.  
  877. The "rcp" command is described in more detail in your TCP/IP package manual
  878. or with the manual that comes with Winsock RCP.  However, here are a few
  879. examples of its use.
  880.  
  881. To copy a file from the host named "srvpc" to your PC or Unix system, use:
  882.   
  883.             rcp srvpc:yourfile myfile
  884.   
  885. The file "yourfile" is copied from the host named "srvpc" to the file on your
  886. PC named "myfile".  The host "srvpc" could be running either Windows and
  887. Winsock RSHD or Unix.
  888.  
  889. To copy a file from your PC or Unix system to the PC named "srvpc", use:
  890.   
  891.             rcp \lists\xmas.doc srvpc:\word\lists
  892.   
  893. The file \lists\xmas.doc is copied from your system to the file xmas.doc in
  894. the directory \word\lists on the PC named "srvpc".
  895.  
  896.   
  897. To send the entire directory tree from your PC or Unix system to "srvpc", use:
  898.   
  899.              rcp -r \share srvpc:\
  900.   
  901. All of the files and subdirectories in the directory \share is copied to the
  902. PC named "srvpc".  It will create a \share directory in the root directory (\)
  903. of srvpc.
  904.  
  905. If the \share directory contained any subdirectories, they would be created
  906. on the other PC and all the files in them would also be copied.
  907.  
  908.  
  909. To copy all of the files ending with ".xls" from "srvpc" to your PC, use:
  910.  
  911.             rcp srvpc:\sheets\*.xls .
  912.  
  913. This copies all of the files ending with ".xls" in the directory \sheets on
  914. "srvpc" to the current directory (.) on your PC.
  915.  
  916.  
  917. You can use drive letters if necessary.  For example, to copy a file from
  918. the A: drive on the "srvpc" to your PC:
  919.  
  920.              rcp srvpc:a:file.txt file.txt
  921.  
  922. This will copy "file.txt" from the A: drive on "srvpc" to the file "file.txt"
  923. on your system.
  924.  
  925.  
  926. NOTE: Winsock RSHD allows you to use both slashes (/) and backslashes (\)
  927.       for directory separators.  It will adjust appropriately.  This is
  928.       especially important for Unix users, since backslashes are interpreted
  929.       by the shell and must be escaped by using two backslashes for every
  930.       one backslash.  Use slashes instead.
  931.  
  932.  
  933. NOTES FOR SCO XENIX
  934. -------------------
  935.  
  936. If you are using SCO Xenix with Excelan's LAN Workplace for Xenix, you may
  937. receive error messages when using "rsh" and "rcp" to access a PC running
  938. Winsock RSHD.  These error messages are basically harmless - both commands
  939. work even though you receive an error message.
  940.  
  941. When using "rsh", you may receive an error about the "stdio" connection being
  942. dropped.  If you do, you can stop this message by using the "-n" option of rsh.
  943.  
  944. For example, use:
  945.  
  946.          rsh winpc2 -n notepad
  947.  
  948. (If you are specifying keystrokes, they go AFTER the "-n").
  949.  
  950. When using "rcp", you may receive a socket error 104.  There is no work around
  951. for this error message.  However, the files will all be copied successfully.
  952. You can ignore this error message.
  953.  
  954.  
  955. SHAREWARE NOTE
  956. --------------
  957.  
  958. The unregistered version of Winsock RSHD is different from the registered
  959. version in the following two ways:
  960.  
  961.     1) When you execute a command using "rsh", Winsock RSHD will return a
  962.        message to the rsh command reminding you that Winsock RSHD is not
  963.        registered.  This message will be displayed on the screen requesting
  964.        the execution of the command.  This will not occur in the registered
  965.        version.
  966.  
  967.     2) At random times on the PC running Winsock RSHD, when Winsock RSHD
  968.        receives a command request it will require you to click on an "OK"
  969.        button in a screen that reminds you that Winsock RSHD is not registered.
  970.  
  971.        This will also cause the "rsh" or "rcp" command on the requesting system
  972.        to ALSO PAUSE until "OK" is clicked on the server PC.  The command WILL
  973.        be completed once "OK" is clicked on the server.
  974.  
  975.        This will not occur more than once per hour.
  976.  
  977.  
  978. WINSOCK RSHD CONFIGURATION FILE
  979. -------------------------------
  980.  
  981. Configuration information for Winsock RSHD is stored in the file WRSHD.INI.
  982. This file must be placed in the Windows directory (usually \WINDOWS).
  983.  
  984. This file is normally created and modified by the Winsock RSHD Configuration
  985. program.  However, you may modify it manually using a text editor.  This section
  986. shows the configuration options that may be placed in the WRSHD.INI file for
  987. those who prefer to configure it manually.
  988.  
  989. If WRSHD.INI does not exist in the Windows directory, default values are
  990. assumed for all options.  No WRSHD.INI file is provided with the Winsock RSHD
  991. distribution.  If you wish to change any of the default values, you must either
  992. use the Configuration program or create the file with your favorite text editor.
  993.  
  994. The WRSHD.INI consists of one section called "[Setup]".  The configuration
  995. options must appear after a line that contains "[Setup]".
  996.  
  997. The configuration options are specified in the format:
  998.  
  999.          Option=Value
  1000.  
  1001. Each of the options were explained in detail earlier in the section on WINSOCK
  1002. RSHD CONFIGURATION.  The following gives the Option names:
  1003. The options are:
  1004.  
  1005. Screen Title                  Option Name
  1006. ------------                  -----------
  1007. Method                        Method
  1008. Minimize on Startup           MinimizeOnStartup
  1009. Message Level                 MessageLevel
  1010. Security File                 SecurityFile
  1011. Request Log                   RequestLog
  1012. Deny Log                      DenyLog
  1013. Error Log                     ErrorLog
  1014. Port                          Port
  1015. RCP Block Size                RCPBlockSize
  1016. Listen Shutdown               ListenShutdown
  1017. Listen Backlog                ListenBacklog
  1018. Listen Linger                 ListenLinger
  1019. Listen KeepAlive              ListenKeepAlive
  1020. Listen ReuseAddr              ListenReuseAddr
  1021. Connection Linger             ConnLinger
  1022. Connection KeepAlive          ConnKeepAlive
  1023. Connection ReuseAddr          ConnReuseAddr
  1024. Connection Shutdown           ConnShutdown
  1025. Stderr Linger                 StderrLinger
  1026. Stderr KeepAlive              StderrKeepAlive
  1027. Stderr ReuseAddr              StderrReuseAddr
  1028. Stderr Shutdown               StderrShutdown
  1029.  
  1030.  
  1031. EXAMPLE WINSOCK RSHD CONFIGURATION FILE
  1032. ---------------------------------------
  1033.  
  1034. The following is an example of the contents of a WRSHD.INI file:
  1035.  
  1036.  
  1037.         [Setup]
  1038.         MinimizeOnStartup=1
  1039.         SecurityFile=C:\WINDOWS\WRSHD.SEC
  1040.         DenyLog=C:\WRSHD\DENY.LOG
  1041.  
  1042.  
  1043. SUPPORT
  1044. -------
  1045.  
  1046. Support is available via U.S. Mail and Compuserve/Internet.
  1047.  
  1048. Denicomp Systems
  1049. P.O. Box 731
  1050. Exton, PA  19341
  1051.  
  1052. Compuserve: 71612,2333
  1053. Internet:   71612.2333@compuserve.com
  1054.  
  1055.